package com.bxait.toymail.auth.server.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author Chen
 * @description: 微信的相关配置
 * @ClassName ConstantWxUtils
 * @create 2023-04-20 22:49
 * @Version 1.0
 */
@Component
public class ConstantWxUtils implements InitializingBean {


    @Value("${wx.open.app_id}")
    private String appId;

    @Value("${wx.open.app_secret}")
    private String appSecret;

    @Value("${wx.open.redirect_url}")
    private String redirectUrl;

    public static String WX_OPEN_APP_ID;
    public static String WX_OPEN_APP_SECRET;
    public static String WX_OPEN_REDIRECT_URL;


    /*
     * @param
     * @==============History===============<br/>
     * @Description // 初始化微信需要用到的相关配置
     * @Date 2023/4/20 22:50
     * @Author <a href="qq:2277411582@qq.com">chen</a>
     * @return void
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        WX_OPEN_APP_ID = appId;
        WX_OPEN_APP_SECRET = appSecret;
        WX_OPEN_REDIRECT_URL = redirectUrl;
    }
}
